home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / CIncludes / Translation.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-17  |  3.5 KB  |  120 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Translation.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __TRANSLATION__
  18. #define __TRANSLATION__
  19.  
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. #if GENERATINGPOWERPC
  26. #pragma options align=mac68k
  27. #endif
  28.  
  29. #ifdef __CFM68K__
  30. #pragma lib_export on
  31. #endif
  32.  
  33. #ifndef REZ
  34.  
  35. #ifndef __TYPES__
  36. #include <Types.h>
  37. #endif
  38. /*    #include <ConditionalMacros.h>                                */
  39.  
  40. #ifndef __FILES__
  41. #include <Files.h>
  42. #endif
  43. /*    #include <MixedMode.h>                                        */
  44. /*    #include <OSUtils.h>                                        */
  45.  
  46. #ifndef __COMPONENTS__
  47. #include <Components.h>
  48. #endif
  49.  
  50. #ifndef __TRANSLATIONEXTENSIONS__
  51. #include <TranslationExtensions.h>
  52. #endif
  53. /*    #include <Memory.h>                                            */
  54. /*    #include <Quickdraw.h>                                        */
  55. /*        #include <QuickdrawText.h>                                */
  56. /*    #include "Components.h"                                        */
  57. typedef short DocOpenMethod;
  58.  
  59.  
  60. enum {
  61.     domCannot,
  62.     domNative,
  63.     domTranslateFirst,
  64.     domWildcard
  65. };
  66.  
  67. typedef OSType TypesBlock[64];
  68.  
  69. typedef OSType *TypesBlockPtr;
  70.  
  71.  
  72. enum {
  73.     TranslationScrapProgressDialogID = -16555
  74. };
  75.  
  76. struct FileTranslationSpec {
  77.     OSType                            componentSignature;
  78.     const void                        *translationSystemInfo;
  79.     FileTypeSpec                    src;
  80.     FileTypeSpec                    dst;
  81. };
  82. typedef struct FileTranslationSpec FileTranslationSpec;
  83.  
  84. typedef FileTranslationSpec *FileTranslationSpecArrayPtr;
  85.  
  86. extern pascal OSErr GetFileTypesThatAppCanNativelyOpen(short appVRefNumHint, OSType appSignature, FileType *nativeTypes)
  87.  TWOWORDINLINE(0x701C, 0xABFC);
  88. extern pascal OSErr ExtendFileTypeList(const FileType *originalTypeList, short numberOriginalTypes, FileType *extendedTypeList, short *numberExtendedTypes)
  89.  TWOWORDINLINE(0x7009, 0xABFC);
  90. extern pascal OSErr CanDocBeOpened(const FSSpec *targetDocument, short appVRefNumHint, OSType appSignature, const FileType *nativeTypes, Boolean onlyNative, DocOpenMethod *howToOpen, FileTranslationSpec *howToTranslate)
  91.  TWOWORDINLINE(0x701E, 0xABFC);
  92. extern pascal short GetFileTranslationPaths(FSSpec *srcDocument, FileType dstDocType, unsigned short maxResultCount, FileTranslationSpecArrayPtr resultBuffer)
  93.  TWOWORDINLINE(0x7038, 0xABFC);
  94. extern pascal OSErr GetPathFromTranslationDialog(const FSSpec *theDocument, const FSSpec *theApplication, const TypesBlockPtr typeList, DocOpenMethod *howToOpen, FileTranslationSpec *howToTranslate)
  95.  TWOWORDINLINE(0x7037, 0xABFC);
  96. extern pascal OSErr TranslateFile(const FSSpec *sourceDocument, const FSSpec *destinationDocument, const FileTranslationSpec *howToTranslate)
  97.  TWOWORDINLINE(0x700C, 0xABFC);
  98. extern pascal OSErr GetDocumentKindString(short docVRefNum, OSType docType, OSType docCreator, Str63 kindString)
  99.  TWOWORDINLINE(0x7016, 0xABFC);
  100. extern pascal OSErr GetTranslationExtensionName(const FileTranslationSpec *translationMethod, Str31 extensionName)
  101.  TWOWORDINLINE(0x7036, 0xABFC);
  102. typedef pascal OSErr (*GetScrapDataProcPtr)(ScrapType requestedFormat, Handle dataH, void *srcDataGetterRefCon);
  103. extern pascal OSErr TranslateScrap(GetScrapDataProcPtr sourceDataGetter, void *sourceDataGetterRefCon, ScrapType destinationFormat, Handle destinationData, short progressDialogID)
  104.  TWOWORDINLINE(0x700E, 0xABFC);
  105. #endif
  106.  
  107. #ifdef __CFM68K__
  108. #pragma lib_export off
  109. #endif
  110.  
  111. #if GENERATINGPOWERPC
  112. #pragma options align=reset
  113. #endif
  114.  
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118.  
  119. #endif /* __TRANSLATION__ */
  120.